﻿#pragma once

namespace libdaq {
namespace device {
enum class LockzhinerADCVoltage {
  ADCVoltage_None = -1,     ///< 未知电压量程
  ADCVoltage_0_1_V = 0,     ///< 0.1V电压量程
  ADCVoltage_0_2_V = 1,     ///< 0.2V电压量程
  ADCVoltage_0_5_V = 2,     ///< 0.5V电压量程
  ADCVoltage_1_V = 3,       ///< 1V电压量程
  ADCVoltage_2_V = 4,       ///< 2V电压量程
  ADCVoltage_2_5_V = 5,     ///< 2.5V电压量程
  ADCVoltage_5_V = 6,       ///< 5V电压量程
  ADCVoltage_10_V = 7,      ///< 10V电压量程
  ADCVoltage_15_V = 8,      ///< 15V电压量程
  ADCVoltage_20_V = 9,      ///< 20V电压量程
  ADCVoltage_50_V = 10,     ///< 50V电压量程
  ADCVoltage_60_V = 11,     ///< 60V电压量程
  ADCVoltage_100_V = 12     ///< 100V电压量程
};

/**
 * @brief ADC触发源配置
 */
enum class DAQADCTriggerSource {
    TriggerSourceSoftware = 0,      ///<软件触发源
};

enum class LockzhinerADCSampleRate {
  ADCSampleRate_None = 0, ///< 未知采样率
  ADCSampleRate_1 = 1, ///< 1采样率
  ADCSampleRate_10 = 10, ///< 10采样率
  ADCSampleRate_100 = 100, ///< 100采样率
  ADCSampleRate_200 = 200, ///< 200采样率
  ADCSampleRate_500 = 500, ///< 500采样率
  ADCSampleRate_1_K = 1000, ///< 1K采样率
  ADCSampleRate_2_K = 2000, ///< 2K采样率
  ADCSampleRate_5_K = 5000, ///< 5K采样率
  ADCSampleRate_10_K = 10000, ///< 10K采样率
  ADCSampleRate_20_K = 20000, ///< 20K采样率
  ADCSampleRate_50_K = 50000, ///< 50K采样率
  ADCSampleRate_100_K = 100000, ///< 100K采样率
  ADCSampleRate_200_K = 200000, ///< 200K采样率
  ADCSampleRate_500_K = 500000, ///< 500K采样率
  ADCSampleRate_800_K = 800000, ///< 800K采样率
  ADCSampleRate_1_M = 1000000, ///< 1M采样率
  ADCSampleRate_2_M = 2000000, ///< 2M采样率
  ADCSampleRate_5_M = 5000000, ///< 5M采样率
  ADCSampleRate_10_M = 10000000, ///< 10M采样率
  ADCSampleRate_25_M = 25000000, ///< 25M采样率
  ADCSampleRate_50_M = 50000000, ///< 50M采样率
  ADCSampleRate_65_M = 65000000, ///< 65M采样率
  ADCSampleRate_100_M = 100000000, ///< 100M采样率
  ADCSampleRate_125_M = 125000000, ///< 125M采样率
  ADCSampleRate_250_M = 250000000, ///< 250M采样率
};

enum LockzhinerADCChannel {
  ADCChannelAINNone = 0b00000000, /// 全不选 | 软件触发
  ADCChannelAIN1 = 0b00000001, /// ADC通道1
  ADCChannelAIN2 = 0b00000001 << 1, /// ADC通道2
  ADCChannelAIN3 = 0b00000001 << 2, /// ADC通道3
  ADCChannelAIN4 = 0b00000001 << 3, /// ADC通道4
  ADCChannelAIN5 = 0b00000001 << 4, /// ADC通道5
  ADCChannelAIN6 = 0b00000001 << 5, /// ADC通道6
  ADCChannelAIN7 = 0b00000001 << 6, /// ADC通道7
  ADCChannelAIN8 = 0b00000001 << 7, /// ADC通道8
};

enum class LockzhinerADCTriggerType {
  Normal = 0x00, ///< 正常模式或滚动模式（不进行触发）
  RisingEdge = 0x01, ///< 上升沿
  FallingEdge = 0x02, ///< 下降沿
  DoubleEdge = 0x03, ///<  双边缘
  ExternalTrigger = 0x04, ///< 外部触发
  Error = 0x05,
};

enum class LockzhinerADCTriggerMode {
  Automatic = 0x00, // 自动触发
  Common = 0x01,  // 普通触发
  Single = 0x02,  // 单次触发
  Error = 0x04,
};

enum class UpgradeFirmwareStatus{
  Idle, // 空闲状态
  Start, // 开始升级
  Erasing, // 正在擦除
  Downloading, // 正在下载
  ReadyNextData, // 准备好接收下一次数据
};

} // namespace device
} // namespace libdaq
